
/**
 * 
 * This is the list item for Ship-mounted and Personal items and abilities.
 *
 */
public class Inventory extends BaphiListItem {
	public enum CombatClass { NonCombat, Contact, Projectile, SpecialAttack, Armor, Mobility, SpecialDefense, Error };
	public enum Mounting { Personal, Ship, Error };
	public enum Type { Ability, Item, Error };
	
	private CombatClass combatClass;
	private Mounting mounting;
	private Type type;
	private boolean tradeable;
	private int strengthTable[];
	
	/**
	 * This is the list item for Ship-mounted and Personal items and abilities.
	 * @param name
	 * @param combatClass - whether it does damage up close or from a distance, helps you dodge, absorbs damage, etc.
	 * @param mounting - Bolted to your ship or hanging from your belt?
	 * @param type - Gizmo or weird mental power/skill?
	 * @param tradeable - can you give it away or trade it to someone else?
	 * @param strengths - how it performs against all possible opponents
	 */
	public Inventory(String name, CombatClass combatClass, Mounting mounting, Type type, boolean tradeable, int[] strengths)
	{
		this.name = name;
		this.combatClass = combatClass;
		this.mounting = mounting;
		this.type = type;
		this.tradeable = tradeable;
		strengthTable = strengths;
	}
	
	/**
	 * Whether it does damage up close or from a distance, helps you dodge, absorbs damage, etc.
	 * @return combat class of inventory item
	 */
	public CombatClass getCombatClass()
	{
		return combatClass;
	}
	
	/**
	 * Bolted to your ship or hanging from your belt?
	 * @return inventory item mounting
	 */
	public Mounting getMounting()
	{
		return mounting;
	}
	
	/**
	 * Gizmo or weird mental power/skill?
	 * @return inventory item type
	 */
	public Type getType()
	{
		return type;
	}
	
	/**
	 * 
	 * @return true if you can give or trade it to someone else
	 */
	public boolean isTradeable()
	{
		return tradeable;
	}
	
	/**
	 * 
	 * @param idx - index into Opponents list
	 * @return inventory item's strength versus that opponent
	 */
	public int lookupStrengthVersusOpponent(int idx)
	{
		return strengthTable[idx];
	}
}
